package cn.zc.boot.controller;

import cn.zc.boot.api.UserService;
import cn.zc.boot.entity.User;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by zhengchuan on 2017/3/8.
 */
@RestController
public class UserController {
    @Reference(version = "1.0.0")
    UserService userService;
    @RequestMapping(value = "/user")
    public User findUserById(Long id) {
        User user = userService.findUserById(id);
        user.setId(Long.valueOf(userService.getUserCount()));
        return user;
    }
}
